/*
 * @description:
 * @version: 1.0.1
 * @Author: xuqiulin
 * @Date: 2021-04-30 19:42:08
 * @LastEditors:
 * @LastEditTime: 2021-04-30 19:42:30
 */
package globalFunc

import "GameServer/Game/m"

var (
	func_ChangeUserSlotActRankGroup func(uid string, newGroupId int64) // 修改用户老虎机活动分组
	func_BroadCastList              func(list []string, data interface{})
	func_BroadData                  func(uid string, data interface{})
	func_SendMailToUid              func(uid string, title string, content string, resGoods []*m.Goods)
	func_GetUserByUid               func(uid string) (r *m.User, ok bool)
)

// --------修改用户老虎机活动分组-------------
// 注册-修改用户老虎机活动分组
func Register_ChangeUserSlotActRankGroup(fun func(uid string, newGroupId int64)) {
	func_ChangeUserSlotActRankGroup = fun
}

// 修改用户老虎机活动分组
func ChangeUserSlotActRankGroup(uid string, newGroupId int64) {
	func_ChangeUserSlotActRankGroup(uid, newGroupId)
}

// --------群体UID广播方法-------------
// 注册-群体UID广播方法
func Register_BroadCastList(fun func(list []string, data interface{})) {
	func_BroadCastList = fun
}

// 群体UID广播方法
func BroadCastList(list []string, data interface{}) {
	func_BroadCastList(list, data)
}

// --------指定UID广播方法-------------
// 注册-指定UID广播方法
func Register_BroadData(fun func(uid string, data interface{})) {
	func_BroadData = fun
}

// 指定UID广播
func BroadData(uid string, data interface{}) {
	func_BroadData(uid, data)
}

// --------指定UID发送邮件-------------
// 注册-指定UID发送邮件
func Register_SendMailToUid(fun func(uid string, title string, content string, resGoods []*m.Goods)) {
	func_SendMailToUid = fun
}

// 指定UID发送邮件
func SendMailToUid(uid string, title string, content string, resGoods []*m.Goods) {
	func_SendMailToUid(uid, title, content, resGoods)
}

// --------根据UID获得玩家的M层信息-------------
func Register_GetUserByUID(fun func(uid string) (r *m.User, ok bool)) {
	func_GetUserByUid = fun
}

func GetUserByUID(uid string) (r *m.User, ok bool) {
	return func_GetUserByUid(uid)
}
